package net.ib.mtalk.ui.setting.user;

import net.ib.mtalk.R;
import net.ib.mtalk.base.BasePreferenceActivity;
import net.ib.mtalk.ui.setting.about.SettingUsageMtalk;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;

public class AddServiceAccountActivity extends BasePreferenceActivity{
	
	private Context mContext;
	
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.list_preference);
		mContext = this;
		
		initPreference();
	}
	
	private void initPreference()
	{
		Preference facebook = (Preference) findPreference(getString(R.string.facebook));
		facebook.setOnPreferenceClickListener(new OnPreferenceClickListener() {
			public boolean onPreferenceClick(Preference preference) {
				Intent intent = new Intent(mContext, FacebookActivity.class);
				intent.putStringArrayListExtra("facebook", getIntent().getStringArrayListExtra("facebook"));
				startActivity(intent);
				return true;
			}
		});
		
		Preference email = (Preference) findPreference(getString(R.string.email));
		email.setOnPreferenceClickListener(new OnPreferenceClickListener() {
			public boolean onPreferenceClick(Preference preference) {
				Intent intent = new Intent(mContext, EmailActivity.class);
				intent.putStringArrayListExtra("email", getIntent().getStringArrayListExtra("email"));
				startActivity(intent);
				return true;
			}
		});
	}
}
